import {Bmobs} from "../plugins/bmob";
import { Service , Inject } from "typedi";

@Service()
export class InfoDao extends Bmobs {
	constructor() {
		super()
	}
	
	public async getCourseByObjectIdDao(id: string): Promise<Array<Object>> {
		this.setTableName("coures");
		return await this.QueryOne(id);
	}
	
	public async getCourseVideoByObjectIdDao(id: string): Promise<Array<Object>> {
		this.setTableName("couresVideo");
		this.query.equalTo("courseObjectid", "==", id);
		return await this.QueryAll();
	}
	
	public async getCurrentPlayVideoDao(id: string): Promise<Array<Object>> {
		this.setTableName("couresVideo");
		this.query.equalTo("objectId", "==", id);
		return await this.QueryAll();
	}
}